3.1.52 \(\int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx\) [52]

3.1.52.1 Optimal result
3.1.52.2 Mathematica [B] (verified)
3.1.52.3 Rubi [A] (verified)
3.1.52.4 Maple [A] (verified)
3.1.52.5 Fricas [A] (verification not implemented)
3.1.52.6 Sympy [F]
3.1.52.7 Maxima [A] (verification not implemented)
3.1.52.8 Giac [A] (verification not implemented)
3.1.52.9 Mupad [B] (verification not implemented)

3.1.52.1 Optimal result

Integrand size = 21, antiderivative size = 80 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=\frac {9 a^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {4 a^3 \sin (c+d x)}{d (1-\cos (c+d x))}+\frac {3 a^3 \tan (c+d x)}{d}+\frac {a^3 \sec (c+d x) \tan (c+d x)}{2 d} \]

output
9/2*a^3*arctanh(sin(d*x+c))/d-4*a^3*sin(d*x+c)/d/(1-cos(d*x+c))+3*a^3*tan( 
d*x+c)/d+1/2*a^3*sec(d*x+c)*tan(d*x+c)/d
 
3.1.52.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(244\) vs. \(2(80)=160\).

Time = 1.52 (sec) , antiderivative size = 244, normalized size of antiderivative = 3.05 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=\frac {a^3 (1+\cos (c+d x))^3 \sec ^6\left (\frac {1}{2} (c+d x)\right ) \left (-18 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+18 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+16 \csc \left (\frac {c}{2}\right ) \csc \left (\frac {1}{2} (c+d x)\right ) \sin \left (\frac {d x}{2}\right )+\frac {1}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {1}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 \sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{32 d} \]

input
Integrate[Csc[c + d*x]^2*(a + a*Sec[c + d*x])^3,x]
 
output
(a^3*(1 + Cos[c + d*x])^3*Sec[(c + d*x)/2]^6*(-18*Log[Cos[(c + d*x)/2] - S 
in[(c + d*x)/2]] + 18*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 16*Csc[c/ 
2]*Csc[(c + d*x)/2]*Sin[(d*x)/2] + (Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^( 
-2) - (Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^(-2) + (12*Sin[d*x])/((Cos[c/2 
] - Sin[c/2])*(Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])* 
(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))))/(32*d)
 
3.1.52.3 Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.96, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 4360, 25, 25, 3042, 25, 3351, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \csc ^2(c+d x) (a \sec (c+d x)+a)^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a-a \csc \left (c+d x-\frac {\pi }{2}\right )\right )^3}{\cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 4360

\(\displaystyle \int \csc ^2(c+d x) \sec ^3(c+d x) \left (-(a (-\cos (c+d x))-a)^3\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int -(\cos (c+d x) a+a)^3 \csc ^2(c+d x) \sec ^3(c+d x)dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int \csc ^2(c+d x) \sec ^3(c+d x) (a \cos (c+d x)+a)^3dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\left (a-a \sin \left (c+d x-\frac {\pi }{2}\right )\right )^3}{\sin \left (c+d x-\frac {\pi }{2}\right )^3 \cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\left (a-a \sin \left (\frac {1}{2} (2 c-\pi )+d x\right )\right )^3}{\cos \left (\frac {1}{2} (2 c-\pi )+d x\right )^2 \sin \left (\frac {1}{2} (2 c-\pi )+d x\right )^3}dx\)

\(\Big \downarrow \) 3351

\(\displaystyle -a^2 \int \left (-a \sec ^3(c+d x)-3 a \sec ^2(c+d x)-4 a \sec (c+d x)-\frac {4 a}{1-\cos (c+d x)}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -a^2 \left (-\frac {9 a \text {arctanh}(\sin (c+d x))}{2 d}-\frac {3 a \tan (c+d x)}{d}+\frac {4 a \sin (c+d x)}{d (1-\cos (c+d x))}-\frac {a \tan (c+d x) \sec (c+d x)}{2 d}\right )\)

input
Int[Csc[c + d*x]^2*(a + a*Sec[c + d*x])^3,x]
 
output
-(a^2*((-9*a*ArcTanh[Sin[c + d*x]])/(2*d) + (4*a*Sin[c + d*x])/(d*(1 - Cos 
[c + d*x])) - (3*a*Tan[c + d*x])/d - (a*Sec[c + d*x]*Tan[c + d*x])/(2*d)))
 

3.1.52.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3351
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) 
 + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[1/a^p   Int[Expan 
dTrig[(d*sin[e + f*x])^n*(a - b*sin[e + f*x])^(p/2)*(a + b*sin[e + f*x])^(m 
 + p/2), x], x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && In 
tegersQ[m, n, p/2] && ((GtQ[m, 0] && GtQ[p, 0] && LtQ[-m - p, n, -1]) || (G 
tQ[m, 2] && LtQ[p, 0] && GtQ[m + p/2, 0]))
 

rule 4360
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si 
n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
 
3.1.52.4 Maple [A] (verified)

Time = 0.80 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.29

method result size
parallelrisch \(\frac {9 a^{3} \left (\left (-\cos \left (2 d x +2 c \right )-1\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (1+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {10 \left (\cos \left (d x +c \right )-\frac {7 \cos \left (2 d x +2 c \right )}{5}-\frac {6}{5}\right ) \cot \left (\frac {d x}{2}+\frac {c}{2}\right )}{9}\right )}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(103\)
norman \(\frac {-\frac {4 a^{3}}{d}+\frac {15 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}-\frac {9 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {9 a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {9 a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(116\)
risch \(-\frac {i a^{3} \left (9 \,{\mathrm e}^{4 i \left (d x +c \right )}-7 \,{\mathrm e}^{3 i \left (d x +c \right )}+21 \,{\mathrm e}^{2 i \left (d x +c \right )}-5 \,{\mathrm e}^{i \left (d x +c \right )}+14\right )}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {9 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}-\frac {9 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}\) \(125\)
derivativedivides \(\frac {a^{3} \left (\frac {1}{2 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3}{2 \sin \left (d x +c \right )}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+3 a^{3} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a^{3} \cot \left (d x +c \right )}{d}\) \(127\)
default \(\frac {a^{3} \left (\frac {1}{2 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3}{2 \sin \left (d x +c \right )}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+3 a^{3} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a^{3} \cot \left (d x +c \right )}{d}\) \(127\)

input
int(csc(d*x+c)^2*(a+a*sec(d*x+c))^3,x,method=_RETURNVERBOSE)
 
output
9/2*a^3*((-cos(2*d*x+2*c)-1)*ln(tan(1/2*d*x+1/2*c)-1)+(1+cos(2*d*x+2*c))*l 
n(tan(1/2*d*x+1/2*c)+1)+10/9*(cos(d*x+c)-7/5*cos(2*d*x+2*c)-6/5)*cot(1/2*d 
*x+1/2*c))/d/(1+cos(2*d*x+2*c))
 
3.1.52.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.52 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=\frac {9 \, a^{3} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 9 \, a^{3} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 28 \, a^{3} \cos \left (d x + c\right )^{3} - 18 \, a^{3} \cos \left (d x + c\right )^{2} + 12 \, a^{3} \cos \left (d x + c\right ) + 2 \, a^{3}}{4 \, d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )} \]

input
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c))^3,x, algorithm="fricas")
 
output
1/4*(9*a^3*cos(d*x + c)^2*log(sin(d*x + c) + 1)*sin(d*x + c) - 9*a^3*cos(d 
*x + c)^2*log(-sin(d*x + c) + 1)*sin(d*x + c) - 28*a^3*cos(d*x + c)^3 - 18 
*a^3*cos(d*x + c)^2 + 12*a^3*cos(d*x + c) + 2*a^3)/(d*cos(d*x + c)^2*sin(d 
*x + c))
 
3.1.52.6 Sympy [F]

\[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=a^{3} \left (\int 3 \csc ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 \csc ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )}\, dx\right ) \]

input
integrate(csc(d*x+c)**2*(a+a*sec(d*x+c))**3,x)
 
output
a**3*(Integral(3*csc(c + d*x)**2*sec(c + d*x), x) + Integral(3*csc(c + d*x 
)**2*sec(c + d*x)**2, x) + Integral(csc(c + d*x)**2*sec(c + d*x)**3, x) + 
Integral(csc(c + d*x)**2, x))
 
3.1.52.7 Maxima [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.71 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=-\frac {a^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 2\right )}}{\sin \left (d x + c\right )^{3} - \sin \left (d x + c\right )} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{3} {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a^{3} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + \frac {4 \, a^{3}}{\tan \left (d x + c\right )}}{4 \, d} \]

input
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c))^3,x, algorithm="maxima")
 
output
-1/4*(a^3*(2*(3*sin(d*x + c)^2 - 2)/(sin(d*x + c)^3 - sin(d*x + c)) - 3*lo 
g(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) + 6*a^3*(2/sin(d*x + c) - l 
og(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 12*a^3*(1/tan(d*x + c) - t 
an(d*x + c)) + 4*a^3/tan(d*x + c))/d
 
3.1.52.8 Giac [A] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.32 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=\frac {9 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 9 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {8 \, a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (5 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 7 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]

input
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c))^3,x, algorithm="giac")
 
output
1/2*(9*a^3*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 9*a^3*log(abs(tan(1/2*d*x 
+ 1/2*c) - 1)) - 8*a^3/tan(1/2*d*x + 1/2*c) - 2*(5*a^3*tan(1/2*d*x + 1/2*c 
)^3 - 7*a^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
 
3.1.52.9 Mupad [B] (verification not implemented)

Time = 14.62 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.22 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^3 \, dx=\frac {9\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {9\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-15\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+4\,a^3}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \]

input
int((a + a/cos(c + d*x))^3/sin(c + d*x)^2,x)
 
output
(9*a^3*atanh(tan(c/2 + (d*x)/2)))/d - (9*a^3*tan(c/2 + (d*x)/2)^4 - 15*a^3 
*tan(c/2 + (d*x)/2)^2 + 4*a^3)/(d*(tan(c/2 + (d*x)/2) - 2*tan(c/2 + (d*x)/ 
2)^3 + tan(c/2 + (d*x)/2)^5))